<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 575px;
            height: 445px;
            margin: 100px auto;
        }
        .box div {
            float: left;
            width: 100px;
            height: 100px;
            margin-right: 15px;
            margin-bottom: 15px;
        }
        .box img {
            width: 100%;
            height: 100%;
        }
    </style>
</head>
<body>
    <script>
        let amount = prompt('请输入要渲染的英雄数量(1-20): ');
        document.write(`<div class="box">`);
        for (let i = 1; i <= amount; i++) {
            document.write(`<div ><img src="images/${i}.webp" alt=""></div>`);
        }
        document.write(`</div>`);
    </script>
</body>
</html>